import { App } from 'vue'
import { useUserStore } from '@/store/module/user'

export const regPermission = (app: App<Element>) => {
  app.directive('permission', {
    mounted(el, binding) {
      // console.log('自定义指令', el, binding)
      const userStore = useUserStore()
      if (!userStore.getPermission.includes(binding.value)) {
        el.remove()
      }
    },
  })
}
